import { request } from "@utils/http/index";


import {
    getHosListReqParamstpe,      //获取医院列表参数中params类型
    getHosListReqReturnType,     //获取医院列表返回值类型
    getProvinceReqReturn,        //请求省的返回值类型
    getHosListByIdReqReturn,     //根据id获取医院信息返回值类型
} from "@api/hospital/model/hospitalListType"



//1.医院列表中 获取分页列表请求
export const getHospitalListRequest = (page:number , limit:number , searchParams:getHosListReqParamstpe) => {
    return request.get<any , getHosListReqReturnType>(`/admin/hosp/hospital/${page}/${limit}` , {
        params: searchParams
    })
}

//2.医院列表中 请求省
export const getProvinceInHosList = () => {
    return request.get<any , getProvinceReqReturn>("/admin/cmn/dict/findByDictCode/province")
}

//3.医院列表中 请求市和区
export const getCityOrBlockReruest = (id:string) => {
    return request.get<any , getProvinceReqReturn>(`/admin/cmn/dict/findByParentId/${id}`)
}

//4.医院详情中 根据id获取对应医院详细信息请求
export const getHospitalListByIdRequest = (id:string) => {
    return request.get<any , getHosListByIdReqReturn>(`/admin/hosp/hospital/show/${id}`)
}

//5.医院列表中 切换状态请求
export const hosListCheckedStatusRequest = (id:string , status: 0 | 1) => {
    return request.get<any , null>(`/admin/hosp/hospital/updateStatus/${id}/${status}`)
}